package com.exchange;
 
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Vibrator;

public class MyApplication extends Application {
	
	static MyApplication instance;
	
	Activity topActivity;
	 
	public static MyApplication getInstance() {
		return instance;
	} 
	
	public void onCreate() {
		super.onCreate();
		instance = this; 
	}
	
	public Activity getTopActivity() {
		return topActivity;
	}
	
	public void setTopActivity( Activity activity ) {
		this.topActivity = activity;
	} 
	
	public static void vibrate( long milliseconds ){
		( ( Vibrator ) MyApplication.getInstance().getSystemService( Context.VIBRATOR_SERVICE ) ).vibrate( milliseconds );
	}
	
}
